<template>
  <div class="baseinfo c-shadow">
    <h4 class="detail-base-title">历史注册地址</h4>
    <div class="table-wrap">
      <div class="box">
        <j-no-data v-if="adedrssDatas.length === 0" :mode="'b'" msg="b"></j-no-data>
        <ol v-else>
          <li v-for="list in adedrssDatas" :key="list.id">
            <span>{{list.date}}</span>
            <span>{{list.space}}</span>
          </li>
        </ol>
      </div>
    </div>
    <h4 class="detail-base-title">企业真实经营地址</h4>
    <j-no-data v-if="addressTDatas.length === 0" :mode="'b'" msg="b"></j-no-data>
    <div class="detail-base-main" v-else>{{addressTDatas}}</div>
    <!-- <div class="table-wrap"> -->
      <!-- <table>
        <thead>
          <tr>
            <th v-for="title in addressTDatas" :key="title">{{title}}</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item,index) in addresscfData" :key="item.shareholder">
            <td>{{index+1}}</td>
            <td class="text-left">{{item.name}}</td>
            <td>{{item.paid_amount|nulldie}}</td>
            <td>{{item.paid_date|nulldie}}</td>
            <td>{{item.subscribed_date|nulldie}}</td>
            <td>{{item.subscribed_amount|nulldie}}</td>
          </tr>
        </tbody>
      </table> -->
      <!-- <div class="clearFix paging-wrap">
        <el-pagination
        v-if="addressPagerData.total>10"
          class="fr "
          @current-change="shareholderPaging"
          :current-page.sync="addressPagerData.pageNum"
          :page-size="addressPagerData.pageSize"
          layout="prev, pager, next, jumper"
          :total="addressPagerData.total">
        </el-pagination>
      </div> -->
    <!-- </div> -->
    <!-- <h4 class="detail-base-title">注册地址重复企业</h4>
    <j-no-data v-if="addresscfData.length === 0" :mode="'b'" msg="b"></j-no-data>
    <div v-else class="table-wrap">
      <table>
        <thead>
        <tr>
          <th v-for="title in addressTDatas" :key="title">{{title}}</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="(item,index) in addresscfData" :key="item.shareholder">
          <td>{{index+1}}</td>
          <td class="text-left">{{item.name}}</td>
          <td>{{item.paid_amount|nulldie}}</td>
          <td>{{item.paid_date|nulldie}}</td>
          <td>{{item.subscribed_date|nulldie}}</td>
          <td>{{item.subscribed_amount|nulldie}}</td>
        </tr>
        </tbody>
      </table>
      <div class="clearFix paging-wrap">
        <el-pagination
          v-if="addressPagerData.total>10"
          class="fr "
          @current-change="shareholderPaging"
          :current-page.sync="addressPagerData.pageNum"
          :page-size="addressPagerData.pageSize"
          layout="prev, pager, next, jumper"
          :total="addressPagerData.total">
        </el-pagination>
      </div>
    </div> -->
  </div>
</template>
<script>
import * as api  from '../../api/entdetail.js'
import { jNoData } from '../../components/index'
export default {
  data() {
    return {
      // 历史
      adedrssDatas: [],
      // 企业真实经营地址
      addressTDatas: [
        // '序号',
        // '企业名称',
        // '法人',
        // '注册资本',
        // '成立时间',
        // '联系方式'
      ],
      addresscfData: [],
      addressPagerData: {
        total: 0,
        pageSize: 10,
        pageNum: 1
      },
      params: {
        pageSize: 10,
        pageNum: 1
      }
    }
  },
  mounted() {
    this.params.entName = this.$route.query.entname
    this.params.entId = this.$route.query.entid
    this.getHistoryList()
    this.getReallyAddress()
  },
  methods: {
    // 获取历史注册地址
    getHistoryList() {
      let param = {
        entName: this.$route.query.entname
      }
      api.getHistoryAddress(param).then(rtn => {
        this.adedrssDatas = rtn.data
        this.adedrssDatas.forEach(address => {
          if (address.space === '空') {
            address.space = '该时期暂无注册地址信息'
          }
        })
      })
    },
    // 获取真实地址重复企业
    getReallyAddress() {
      let param = {
        entName: this.$route.query.entname
      }
      api.getReallyAddress(param).then(rtn => {
        if (typeof rtn.data !== 'undefined' && rtn.data !== 'null') {
          this.addressTDatas = rtn.data
        }
      })
    }

    // getshareHolder(param) {
    //   if (param) {
    //     this.params = Object.assign(this.params, param)
    //   }
    //   api.getShareholder(this.params).then(ret => {
    //     this.addresscfData = ret.data.list
    //     this.addressPagerData.total = ret.data.total
    //   })
    // }
    // shareholderPaging(index) {
    //   this.addressPagerData.pageNum = index
    //   this.getshareHolder(this.addressPagerData)
    // }
  },
  components: {
    jNoData
  }
}
</script>
<style lang="scss" scoped>
.baseinfo {
  .text-left {
    text-align: left;
    padding-left: 20px;
  }
  padding: 0 20px;
  h4.detail-base-title {
    line-height: 30px;
    font-size: 16px;
    font-weight: bold;
    padding: 30px 0 0 12px;
    position: relative;
    background-image: linear-gradient(0deg, #1891ef, #1891ef);
    background-size: 3px 16px;
    background-position: 0 37px;
    background-repeat: no-repeat;
    border-bottom: 1px solid #eee;
  }
  .detail-base-main {
    padding: 30px 0 20px 20px;
  }
  h4.detail-base-title span {
    border: 1px solid #9dc5fd;
    border-radius: 10px;
    color: #1688f3;
    background: #f2f7ff;
    font-size: 12px;
    padding: 0 10px;
    margin-left: 15px;
    vertical-align: top;
  }
  .table-wrap {
    padding: 30px 20px;
    table {
      border-collapse: collapse;
      width: 100%;
      text-align: center;
      td,
      th {
        border: 1px solid #e2e2e2;
        line-height: 40px;
      }
      th {
        line-height: 38px;
        color: #999;
        background: #f2f1f1;
      }
      th:nth-child(1) {
        width: 110px;
      }
      th:nth-child(2) {
        width: 320px;
      }
    }
  }
  .box {
    width: 800px;
    padding-bottom: 20px;
    // height: 310px;
    // background: url('../../assets/images/trend.png') no-repeat;
    /*background-color: red;*/
    margin: 0 auto;
    ol {
      width: 100%;
      padding-left: 50px;
      box-sizing: border-box;
      li{
        height: auto;
        span{
          width:100%;
          font-size: 16px;
          color: #539cff;
        }
        // span:nth-child(2) {
        //   width:100%;
        //   font-weight: bold;
        // }
      }
      li {
        width: 100%;
        position: relative;
        top: -2px;
        padding-bottom: 20px;
        background: url('../../assets/images/circle1.png') no-repeat;
        // height: 45px;
        // line-height: 60px;
        &:nth-child(1){
          // height: 20px;
          background: url('../../assets/images/circle.png') no-repeat;
          // line-height: 20px;
        }
        span {
          display: inline-block;
          // width: 100%;
          font-size: 14px;
          color: #539cff;
          margin-left: 40px;
        }
        span:nth-child(2){
          color:#000;
          margin-top: 5px;
        }
        // span:nth-child(2) {
        //   color: #404450;
        //   font-size: 14px;
        //   margin-left: 50px;
        // }
      }
    }
  }
}
</style>



// WEBPACK FOOTER //
// src/view/entDetail/address.vue
